<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ title }}</title>
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }
        
        h1 {
            color: #2c3e50;
            border-bottom: 2px solid #eee;
            padding-bottom: 10px;
        }
        
        h2 {
            color: #34495e;
            margin-top: 30px;
        }
        
        h3 {
            color: #2c3e50;
            margin-top: 20px;
        }
        
        .summary {
            background-color: #f8f9fa;
            padding: 20px;
            border-radius: 5px;
            margin: 20px 0;
        }
        
        .summary-item {
            margin: 10px 0;
        }
        
        .resource-card {
            border: 1px solid #ddd;
            border-radius: 5px;
            padding: 15px;
            margin: 15px 0;
            background-color: #fff;
        }
        
        .status-healthy {
            color: #28a745;
        }
        
        .status-warning {
            color: #ffc107;
        }
        
        .status-critical {
            color: #dc3545;
        }
        
        .status-unknown {
            color: #6c757d;
        }
        
        .issues-list, .suggestions-list {
            margin: 10px 0;
            padding-left: 20px;
        }
        
        .issues-list li {
            color: #dc3545;
        }
        
        .suggestions-list li {
            color: #28a745;
        }
        
        .score {
            font-weight: bold;
            font-size: 1.2em;
        }
        
        .score-high {
            color: #28a745;
        }
        
        .score-medium {
            color: #ffc107;
        }
        
        .score-low {
            color: #dc3545;
        }
        
        @media print {
            body {
                padding: 0;
            }
            
            .resource-card {
                break-inside: avoid;
            }
        }
    </style>
</head>
<body>
    <h1>{{ title }}</h1>
    
    <div class="summary">
        <h2>Summary</h2>
        <div class="summary-item">Total Resources: {{ summary.total_resources }}</div>
        <div class="summary-item">Healthy: {{ summary.healthy }}</div>
        <div class="summary-item">Warning: {{ summary.warning }}</div>
        <div class="summary-item">Critical: {{ summary.critical }}</div>
        <div class="summary-item">Unknown: {{ summary.unknown }}</div>
        <div class="summary-item">Average Score: {{ "%.2f"|format(summary.average_score) }}</div>
    </div>
    
    <h2>Details</h2>
    {% for resource_id, result in details.items() %}
    <div class="resource-card">
        <h3>{{ resource_id }}</h3>
        <div class="status-{{ result.status }}">Status: {{ result.status }}</div>
        <div class="score score-{{ 'high' if result.score >= 70 else 'medium' if result.score >= 40 else 'low' }}">
            Score: {{ result.score }}
        </div>
        <div>Message: {{ result.message }}</div>
        
        {% if result.issues %}
        <div>
            <h4>Issues:</h4>
            <ul class="issues-list">
                {% for issue in result.issues %}
                <li>{{ issue }}</li>
                {% endfor %}
            </ul>
        </div>
        {% endif %}
        
        {% if result.suggestions %}
        <div>
            <h4>Suggestions:</h4>
            <ul class="suggestions-list">
                {% for suggestion in result.suggestions %}
                <li>{{ suggestion }}</li>
                {% endfor %}
            </ul>
        </div>
        {% endif %}
    </div>
    {% endfor %}
</body>
</html> 